package service

import (
	"context"

	"github.com/google/wire"
)

var ChainServiceSet = wire.NewSet(wire.Struct(new(ChainService), "*"))

type ChainService struct {
}

func UpToChain(ctx context.Context) error {
	// sdk, err := fabsdk.New(config.FromFile(""))
	// if err != nil {
	// 	log.Panicf("failed to create fabric sdk: %s", err)
	// }
	// rcp := sdk.Context(fabsdk.WithUser("Admin"), fabsdk.WithOrg("Org1"))
	// rc, err := resmgmt.New(rcp)
	// if err != nil {
	// 	log.Panicf("failed to create resource client: %s", err)
	// }

	// ccp := sdk.ChannelContext(0, fabsdk.WithUser("User1"))
	// cc, err := channel.New(ccp)
	// if err != nil {
	// 	log.Panicf("failed to create channel client: %s", err)
	// }

	// args := []string{"a", "b", "10"}
	// req := channel.Request{
	// 	ChaincodeID: "",
	// 	Fcn:         "invoke",
	// 	Args:        args,
	// }

	// // send request and handle response
	// reqPeers := channel.WithTargetEndpoints("peer0.org1.example.com")
	// resp, err := cc.Execute(req, reqPeers)
	// if err != nil {
	// 	return errors.WithMessage(err, "invoke chaincode error")
	// }
	// log.Printf("invoke chaincode tx: %s", resp.TransactionID)
	return nil
}
